package day7;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Hashtable;

/**
 * @author oldliu
 * @since 1.0
 */
public class ClsTest {
    public static void main(String[] args) {
        Class c1=ObjGet.class;
        Class c2=String.class;
        Class c3=double.class;
        Class c4= Hashtable.class;
        System.out.println(c4.getName());
        System.out.println("父类："+c4.getSuperclass().getName());
        Class[] interfaces = c4.getInterfaces();
        System.out.println("接口:");
        for(Class cc:interfaces)
            System.out.println(cc.getName());
        System.out.println(">>>>>>>>>>>属性>>>>>>>>>>>>>");
        Field[] fields = c4.getDeclaredFields();
        for(Field f:fields)
            System.out.println(f);
        System.out.println(">>>>>>>>>>>>方法》》》》》》》");
        Method[] methods = c4.getDeclaredMethods();
        for(Method m:methods)
            System.out.println(m);
        System.out.println(">>>>>>>>构造方法》》》》》》");
        Constructor[] constructors = c4.getDeclaredConstructors();
        for(Constructor cr:constructors)
            System.out.println(cr);
    }
}
